#pragma once
#include "BaseObject.hpp"

// This class managed the side bar and all of its actions
//
// The structure is complex enough to be a class, but I left it as a struct instead.
// I did this in order to have access to everything from anywhere I needed since it
// interacted with multiple other classes
//
// The menu receives players stats every update so that it can display his health and
// gold count
struct Menu : public BaseObject
{
	//Sidebar info
	LPDIRECT3DTEXTURE9	m_pAllMenuStates[MENU_STATE_SIZE];
	D3DXCOLOR			m_Color;
	D3DXMATRIX			m_Translate;
	D3DSURFACE_DESC		m_pDesc[MENU_STATE_SIZE];
	D3DXVECTOR3			m_vCenter[MENU_STATE_SIZE];
	
	//Info on all the buttons
	RECT				Boxes[MENU_BUTTONS_SIZE];
	eMenuStates			m_CurrentState;
	int					m_ButtonPressedID;
	bool				m_bPressed;
	float				m_ButtonTimer;

	//All text to display
	RECT				m_Displays[5];
	std::ostringstream	m_Buffers[5];

	Menu();
	~Menu(){}
	void Reset();
	void SetButtonBoxes();
	void SetMenuState();
	int GetState();
	int GetButtonPresesd();
	bool ButtonPressed();
	bool ButtonPressed(int ID);
	bool CheckBoundingBoxes(COORD Pos);
	void SetTextInfo();
	void TranslateMessages();
	void* Update(void* Data);
};